home *** CD-ROM | disk | FTP | other *** search
/ Aminet 39 / Aminet 39 (2000)(Schatztruhe)[!][Oct 2000].iso / Aminet / gfx / misc / Splitmpeg.lha / Splitmpeg / src / errmsg.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-22  |  3.5 KB  |  76 lines

  1. /*
  2.  * Copyright (c) 1994 Michael Simmons.
  3.  * All rights reserved.
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software and its
  6.  * documentation for any purpose, without fee, and without written agreement is
  7.  * hereby granted, provided that the above copyright notice and the following
  8.  * two paragraphs appear in all copies of this software.
  9.  *
  10.  * IN NO EVENT SHALL MICHAEL SIMMONS BE LIABLE TO ANY PARTY FOR
  11.  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
  12.  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF MICHAEL SIMMONS
  13.  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14.  *
  15.  * THE MICHAEL SIMMONS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16.  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17.  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18.  * ON AN "AS IS" BASIS, AND MICHAEL SIMMONS HAS NO OBLIGATION TO
  19.  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20.  *
  21.  * I can be contacted via
  22.  * Email: michael@ecel.uwa.edu.au
  23.  * Post: P.O. Box 506, NEDLANDS WA 6009, AUSTRALIA
  24.  *
  25.  * Amigaversion by Tobias Seiler in 1997
  26.  */
  27.  
  28. #include "main.h"
  29.  
  30. void errmsg( unsigned int err )
  31. {
  32.   printf("\n");
  33.   fprintf(stderr,"\nBlast it an ERROR %0X has occured!\n",err);
  34.  
  35.   fprintf(stderr,"I was ");
  36.   switch( err & ERR_MASK2){
  37.     case NO_ERROR:    fprintf(stderr,"doing something");break;
  38.     case ERR_PARSE_PACK_HDR: fprintf(stderr,"parsing a Pack Header");break;
  39.     case ERR_PARSE_SYSTEM_HDR: fprintf(stderr,"parsing a System Header");break;
  40.     case ERR_PARSE_PACKET:  fprintf(stderr,"parsing a Packet");break;
  41.     case ERR_PROCESS_PACKET: fprintf(stderr,"parsing a Processing a Packet");break;
  42.     case ERR_DIFF_SYSTEM_HDR: fprintf(stderr,"comparing two System Headers");break;
  43.     default:     fprintf(stderr,"a bit confused");break;
  44.   }
  45.  
  46.   fprintf(stderr," while I was ");
  47.   switch( err & ERR_MASK1){
  48.     case NO_ERROR:    fprintf(stderr,"doing something");break;
  49.     case ERR_PARSE_PACK:  fprintf(stderr,"parsing a Pack");break;
  50.     default:     fprintf(stderr,"confused");break;
  51.   }
  52.  
  53.   fprintf(stderr," and \nI ");
  54.   switch( err & ERR_MASK3){
  55.     case NO_ERROR:    fprintf(stderr,"had an error"); break;
  56.     case ERR_READ_BITSTREAM: fprintf(stderr,"had trouble reading the BitStream");break;
  57.     case ERR_UNEXPECTED_EOF: fprintf(stderr,"had an Unexpected EOF pop up");break;
  58.     case ERR_NO_BIT_STREAM:     fprintf(stderr,"discovered that the BitStream was not open");break;
  59.     case ERR_INVALID_MARKER: fprintf(stderr,"came across an Invaild Marker");break;
  60.     case ERR_MISSING_SYSTEM_HDR: fprintf(stderr,"couldn't find a starting System Header");break;
  61.     case ERR_OPEN_ESTREAM:     fprintf(stderr,"trouble opening an Elemental Stream");break;
  62.     case ERR_NO_PACKET_BUFFER: fprintf(stderr,"discovered that there was no packet buffer");break;
  63.     case ERR_WRITE_ESTREAM:     fprintf(stderr,"trouble writing to an Elemental System");break;
  64.     case ERR_MISSING_END_CODE: fprintf(stderr,"found the BitStream was missing an End Code");break;
  65.     case ERR_NOT_SYSTEM_LAYER: fprintf(stderr,"was not a System Layer Stream");break;
  66.     case ERR_OPEN_BSTREAM:     fprintf(stderr,"the BitStream Could not be opened");break;
  67.     case ERR_MALLOC:      fprintf(stderr,"had trouble Allocating some memory");break;
  68.     case ERR_INVALID_BITS:     fprintf(stderr,"had a invalid bit sequence");break;
  69.     case ERR_INVALID_STREAM_NUM:fprintf(stderr,"had a invalid stream number turn up");break;
  70.     default:     fprintf(stderr,"had a Programmer Error");break;
  71.   }
  72.  
  73.   fprintf(stderr,".\n");
  74. }
  75.  
  76.